package com.zds.hj.poseidon.biz.common;

import com.zds.hj.product.facade.dto.product.ProductDetailDto;
import com.zds.hj.product.facade.interfaces.product.ProductInterface;
import com.zds.zly.common.constant.CommConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName ProductServiceInterface
 * @Description 产品服务的接口
 * @Author jinghao
 * @Date 2021/4/1 11:24
 * @Version 1.0
 */
@Slf4j
@Service
public class ProductServiceInterface {

    @DubboReference(owner = CommConstant.DUBBO_OWNER, version = CommConstant.DUBBO_VERSION)
    private ProductInterface productInterface;


    /**
     * @param
     * @return java.util.List<com.zds.hj.product.facade.dto.product.ProductDetailDto>
     * @Author jingyh
     * @Description 查询所有启用的产品
     **/
    public List<ProductDetailDto> selectEnableProducts() {
        return productInterface.selectEnableProducts();
    }


    /**
     * @param productId :
     * @return com.zds.hj.product.facade.dto.product.ProductDetailDto
     * @Author jingyh
     * @Description 获取产品详情
     **/
    public ProductDetailDto getProductDetailById(Long productId) {
        log.info("查询产品id入参: {}", productId);
        return productInterface.getProductDetailById(productId);
    }

    /**
     * @param productId :
     * @return com.zds.hj.product.facade.dto.product.ProductDetailDto
     * @Author jingyh
     * @Description 根据产品Id查询产品基础信息
     **/
    public ProductDetailDto getProductDetailBasicById(Long productId) {
        log.info("查询产品id入参: {}", productId);
        return productInterface.getProductDetailBasicById(productId);
    }

    /**
     * @param productNo :
     * @return com.zds.boot.common.facade.SingleResult<com.zds.hj.product.facade.dto.product.ProductDetailBasicDto>
     * @Author jingyh
     * @Description 根据产品编号查询产品信息
     **/
    public ProductDetailDto getProductDetailBasicByPno(String productNo) {
        log.info("查询产品编号入参: {}", productNo);
        return productInterface.getProductDetailBasicByPno(productNo);
    }


}
